<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>CSS特性</title>
    <style>
      div {
        /* 继承性：div之下的元素都能继承文本和字体相关的样式 */
        color: red;
      }

      p {
        /* 层叠性 !important使其优先级最高 */
        background-color: green !important;
      }

      #p1 {
        /* 优先级 */
        color: aqua;
      }
    </style>
  </head>

  <body>
    <p id="p1">p1</p>
    <div>
      <p>p2</p>
      <span>span1</span>
      <a href="">超链接</a>
    </div>
  </body>
</html>
